package com.xlgroup.javainterview;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

import com.xlgroup.AppMain;
import com.xlgroup.R;

public class JavaMain extends Activity {
    /** Called when the activity is first created. */
	Button back;
	Button find;
	EditText et;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.java);
        TextView tv = (TextView)this.findViewById(R.id.appMain);
        find = (Button)this.findViewById(R.id.find);
        back = (Button)this.findViewById(R.id.javaBack);
        et = (EditText)this.findViewById(R.id.keyword);

        find.setOnClickListener(new Button.OnClickListener(){
			public void onClick(View v) {
		        if(!"".equals(et.getText().toString())){
		        	//查询本地
		        }else{
		            Toast.makeText(JavaMain.this,"请输入关键字！",Toast.LENGTH_LONG).show();
		        }
			}
        });
        back.setOnClickListener(new Button.OnClickListener(){
			public void onClick(View v){
					Intent intent = new Intent();
					intent.setClass(JavaMain.this,AppMain.class);
					startActivity(intent);
					JavaMain.this.finish();
			}
		});
    }
}